class Solution {
    public int findContentChildren(int[] g, int[] s) {
        int num=0;
        Arrays.sort(g);
        Arrays.sort(s);
        int len1=g.length;
        int len2=s.length;
        int gg=0;
        int ss=0;
        while(gg<len1&&ss<len2)
        {
            if(s[ss]>=g[gg])
            {
                ss++;
                gg++;
                num++;
            }
            else{
                ss++;
            }
        }
        return num;

    }
}
